package com.netease.b.a;

import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import com.netease.a.a.e;
import com.netease.b.b.e.j;
import com.netease.c.f;
import com.netease.framework.a.m;
import com.netease.pris.a.r;
import com.netease.pris.atom.ac;
import com.netease.pris.atom.u;
import com.netease.pris.c.l;
import java.io.File;
import java.util.Vector;

public class g extends ag
{
  public static final int a = 0;
  public static final int b = 1;
  static final String c = "PRISTransactionImage";
  m d;
  String e;
  u f;
  int g;
  boolean i;
  boolean j;
  boolean k;
  boolean l;
  int m;
  int n;
  byte o = -1;

  protected g(String paramString, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, int paramInt)
  {
    super(paramInt);
    this.e = paramString;
    this.j = paramBoolean1;
    this.l = paramBoolean2;
    this.k = paramBoolean3;
  }

  public static g a(String paramString)
  {
    return new g(paramString, true, false, false, 1002);
  }

  public static g a(String paramString, int paramInt, boolean paramBoolean)
  {
    g localg = new g(paramString, true, false, false, 1000);
    localg.i = paramBoolean;
    localg.g = paramInt;
    return localg;
  }

  public static g a(String paramString, u paramu)
  {
    g localg = new g(paramString, false, false, false, 1001);
    localg.f = paramu;
    return localg;
  }

  public static g a(String paramString, boolean paramBoolean1, boolean paramBoolean2, int paramInt1, int paramInt2, int paramInt3)
  {
    if ((paramInt2 > 0) && (paramInt3 > 0));
    for (String str = paramString + "%local&w=" + paramInt2 + "&h=" + paramInt3; ; str = paramString)
    {
      g localg = new g(str, true, paramBoolean1, paramBoolean2, 1000);
      localg.o = (byte)paramInt1;
      localg.m = paramInt2;
      localg.n = paramInt3;
      return localg;
    }
  }

  public static g a(String paramString, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3)
  {
    return new g(paramString, paramBoolean1, paramBoolean2, paramBoolean3, 1000);
  }

  public static g a(String paramString, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, boolean paramBoolean4)
  {
    g localg = new g(paramString, paramBoolean1, paramBoolean2, paramBoolean3, 1000);
    localg.i = paramBoolean4;
    return localg;
  }

  private void a(Bitmap paramBitmap, b paramb)
  {
    if ((paramBitmap == null) || (paramb == null) || (paramb.b == null));
    while (true)
    {
      return;
      if ((this.m > 0) && (this.n > 0))
      {
        if ((paramBitmap.getWidth() == this.m) && (paramBitmap.getHeight() == this.n))
        {
          paramb.c = paramBitmap;
          continue;
        }
        Bitmap localBitmap = com.netease.pris.a.p.b(paramBitmap, this.m, this.n);
        if ((localBitmap == null) || (paramb.c == localBitmap))
          continue;
        e.a(new File(paramb.b));
        com.netease.pris.a.p.a(localBitmap, 75, paramb.b, Bitmap.CompressFormat.JPEG);
        e.c(new File(paramb.b));
        paramb.c.recycle();
        paramb.c = null;
        paramb.c = localBitmap;
        continue;
      }
    }
  }

  private boolean a()
  {
    int i1 = 0;
    int i2 = "file:///android_asset/".length();
    int i3;
    if ((this.e != null) && (this.e.length() > i2 + 11) && ("img?id=".equals(this.e.substring(i2, i2 + 7))))
    {
      i3 = this.e.indexOf("&url=", i2 + 7);
      if (i3 <= 0);
    }
    try
    {
      this.g = Integer.parseInt(this.e.substring(i2 + 7, i3));
      this.e = f.a(this.e.substring(i3 + 5), "utf-8");
      i1 = 1;
      return i1;
    }
    catch (Exception localException)
    {
      while (true)
        localException.printStackTrace();
    }
  }

  private static boolean a(com.netease.pris.atom.b paramb)
  {
    if ((paramb == com.netease.pris.atom.b.b) || (paramb == com.netease.pris.atom.b.c));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  private ac b(com.netease.pris.atom.b paramb)
  {
    ac localac = null;
    if (paramb == com.netease.pris.atom.b.b)
    {
      j localj2 = l.b(d.h().a(), d.h().c(), 3);
      if (localj2 != null)
        localac = new ac(localj2);
    }
    while (true)
    {
      return localac;
      if (paramb != com.netease.pris.atom.b.c)
        continue;
      j localj1 = l.b(d.h().a(), d.h().c(), 1);
      if (localj1 == null)
        continue;
      localac = new ac(localj1);
    }
  }

  public com.netease.framework.b.b a(Object paramObject, int paramInt1, int paramInt2)
  {
    return new p(this, this, paramObject, paramInt1, paramInt2);
  }

  public com.netease.framework.b.b a(Vector paramVector, Object paramObject, int paramInt1, int paramInt2)
  {
    return new p(this, paramVector, paramObject, paramInt1, paramInt2);
  }

  protected void a(int paramInt, Object paramObject)
  {
    if ((n() == 1001) && (this.f != null))
    {
      com.netease.pris.c.c.a(d.h().a(), this.f);
      this.f.d(false);
      super.a(paramInt, paramObject);
    }
    while (true)
    {
      return;
      c(this.g, paramObject);
    }
  }

  public void b(int paramInt, Object paramObject)
  {
    if (n() == 1001)
      super.b(paramInt, paramObject);
    while (true)
    {
      return;
      d(paramInt, this.e);
    }
  }

  public void c()
  {
    Object localObject = null;
    switch (n())
    {
    default:
      if (localObject != null)
        break;
      d(0, this.e);
      h();
    case 1001:
    case 1002:
    case 1000:
    }
    while (true)
    {
      return;
      if (this.f == null)
        break;
      com.netease.pris.atom.b localb = this.f.be();
      ac localac;
      if (a(localb))
      {
        localac = b(localb);
        if (localac == null)
        {
          d(501, null);
          h();
          continue;
        }
      }
      else
      {
        localac = null;
      }
      localObject = com.netease.pris.protocol.c.b(this.e, localac, d.h().c(), d.h().d());
      break;
      if (!a())
      {
        h();
        continue;
      }
      if (this.j)
      {
        String str4 = e.a(r.a(this.e), this.i);
        if (str4 != null)
        {
          b localb2 = new b();
          localb2.b = str4;
          localb2.a = this.e;
          localb2.d = this.o;
          if (this.k)
          {
            localb2.c = com.netease.pris.a.p.a(str4);
            if (localb2.c != null)
              break label269;
            e.a(new File(str4));
            localb2 = null;
          }
          while (true)
          {
            if (localb2 == null)
              break label283;
            c(this.g, localb2);
            h();
            break;
            label269: a(localb2.c, localb2);
          }
        }
      }
      label283: if ((this.m > 0) && (this.n > 0))
      {
        int i1 = this.e.lastIndexOf("%local");
        String str1 = this.e.substring(0, i1);
        String str2 = r.a(str1);
        String str3 = e.a(str2, this.i);
        if (str3 != null)
        {
          b localb1 = new b();
          localb1.b = (e.f() + "/" + str2);
          localb1.a = this.e;
          localb1.d = this.o;
          if (this.k)
          {
            localb1.c = com.netease.pris.a.p.a(str3);
            if (localb1.c == null)
              e.a(new File(str3));
          }
          while (true)
          {
            if (localObject == null)
              break label474;
            c(this.g, localObject);
            h();
            break;
            a(localb1.c, localb1);
            localObject = localb1;
          }
        }
        label474: localObject = new m(str1);
        ((m)localObject).a(this.e.substring(i1));
        break;
      }
      localObject = new m(this.e);
      break;
      this.d = ((m)localObject);
      this.d.d(true);
      this.d.g(true);
      if (this.j)
        ((m)localObject).e(true);
      this.d.i(true);
      this.d.h(this.i);
      this.d.c(true);
      this.d.e(n());
      this.d.f(l());
      a(this.d);
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.b.a.g
 * JD-Core Version:    0.6.0
 */